#!/bin/sh

echo " ██    ██"
echo "░░██  ██"
echo " ░░████    ██████  ██████  ██████  ██████  ██████"
echo "  ░░██    ██░░░░██░░░░██  ██░░░░██░░██░░█ ░░░░░░██"
echo "   ░██   ░██   ░██   ██  ░██   ░██ ░██ ░   ███████"
echo "   ░██   ░██   ░██  ██   ░██   ░██ ░██    ██░░░░██"
echo "   ░██   ░░██████  ██████░░██████ ░███   ░░████████"
echo "   ░░     ░░░░░░  ░░░░░░  ░░░░░░  ░░░     ░░░░░░░░"

echo ""
redis-server redis-cluster/7000/redis.conf
redis-server redis-cluster/7001/redis.conf
redis-server redis-cluster/7002/redis.conf
redis-server redis-cluster/7003/redis.conf
redis-server redis-cluster/7004/redis.conf
redis-server redis-cluster/7005/redis.conf

#ip=10.38.1.184

if [ -f 'redis-cluster.init'];then
    echo ""
else
    redis-cli --cluster create --cluster-replicas 1 --cluster-yes $IP:7000 $IP:7001 $IP:7002 $IP:7003 $IP:7004 $IP:7005
    touch redis-cluster.init
fi

tail -f redis-cluster.init
